<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<title>Editar Informações | Linkers</title>
	<link rel="stylesheet" type="text/css" href="css/estrutura.css" />
	<script type="text/javascript" src="js/control.js"></script>

	<link rel="icon" href="imgs/favicon.ico" type="image/x-icon" />
	<link rel="shortcut icon" href="imgs/favicon.ico" type="image/x-icon" />
	<link rel="shortcut icon" href="imgs/favicon.ico"
		type="image/vnd.microsoft.icon" />
</h:head>
<body>

	#{usuarioBean.permissaoLogado()}

	<div class='center'>

		<div class='inner'>
			<div class='top'>



				<div class='perfil'>
					<img id='perfil' src="user/perfil.jpg" />
				</div>

				<div class='dados'>
					<div class='nome'>
						<h:outputText value="#{usuarioBean.usuarioLogado.nome}" />

						<a href="#opcoes" onclick="PF('dlgopcoes').show();"><img
							src="imgs/seta-info.png" /></a>
					</div>
					<div class='numero'>
						<h:outputText value="#{telefoneBean.telefoneLogadoFormatado}" />

					</div>
					<div>
						<h:form>
							<h:commandLink action="#{usuarioBean.logout()}" value="Logout" />
						</h:form>
					</div>
				</div>

				<div class='logo-linkers'>
					<img src="imgs/linkers-logo.png" />
				</div>
			</div>
		</div>

		<div class='contorno'>

			<div class='meio'>

				<div class='inner'>




					<!-- Editar Informações -->
					<h:form>
						<div class="clearb"></div>

						<h1 style="color: #333">Editar Informações</h1>

						<center>
							<img src="user/perfil.jpg" height="150px" />
						</center>


						<div>
							<!-- Paineil -->



							<p:inputText value="#{usuarioBean.usuarioLogado.nome}"
								placeholder="Nome" styleClass="tfp t50" />
							<p:inputText value="#{usuarioBean.usuarioLogado.sobrenome}"
								placeholder="Sobrenome" styleClass="tfp t50" />
							<div class="clearb"></div>

							<p:selectOneMenu value="Pais" styleClass="tfp">
								<f:selectItem itemLabel="Brasil" itemValue="1" />
							</p:selectOneMenu>
							<p:selectOneMenu value="Estado" styleClass="tfp">
								<f:selectItem itemLabel="Ceará" itemValue="1" />
							</p:selectOneMenu>
							<p:selectOneMenu value="Cidade" styleClass="tfp">
								<f:selectItem itemLabel="Fortaleza" itemValue="1" />
								<f:selectItem itemLabel="São Gonçalo do Amarante" itemValue="2" />
							</p:selectOneMenu>
							<p:inputText value="#{usuarioBean.usuarioLogado.endereco}"
								placeholder="Endereço" styleClass="tfp t50" />
							<div class="clearb"></div>


							<p:inputText value="#{usuarioBean.usuarioLogado.login}"
								disabled="true" placeholder="Login" styleClass="tfp" />
							<p:password value="#{usuarioBean.usuarioLogado.senha}"
								placeholder="Senha" styleClass="tfp" />
							<div class="clearb"></div>



							<!-- enum não funcionando / converter falha 
		<p:selectOneMenu value="#{usuarioBean.usuarioLogado.sexo}" effect="fade">  
			<f:selectItem itemLabel="#{usuarioBean.usuarioLogado.sexo.descricao}" itemValue="#{usuarioBean.usuarioLogado.sexo}" />  
			<f:selectItems value="#{enumBean.sexos}" var="var" itemLabel="#{var.descricao}" itemValue="#{var}"/>  
		</p:selectOneMenu>  -->


						</div>

						<div class="clearb"></div>
						<p:commandButton value="Atualizar Informações"
							actionListener="#{usuarioBean.editaInfo()}" ajax="false" />
						<div class="clearb"></div>
					</h:form>




					<!-- Telefones -->
					<br />
					<br />
					<h1 style="color: #333">Meus Telefones</h1>
					<h:form>
						<p:dataTable var="tel" value="#{telefoneBean.telefonesUL}">
							<p:column headerText="DDD">
								<h:outputText value="#{tel.ddd}" />
							</p:column>

							<p:column headerText="Número">
								<h:outputText value="#{tel.numero}" />
							</p:column>

							<p:column headerText="Operadora">
								<h:outputText value="#{tel.operadora}" />
							</p:column>

							<p:column headerText="Tipo">
								<h:outputText value="#{tel.tipo}" />
							</p:column>
							<p:column headerText="Ações">
								<p:commandButton value="Editar"
									actionListener="#{telefoneBean.editarTel(tel)}" />
								<p:commandButton value="Excluir"
									actionListener="#{telefoneBean.removerTel(tel)}">
									<p:confirm header="Tem certeza?"
										message="Você tem certeza que deseja apagar este telefone?"
										icon="ui-icon-alert" />
								</p:commandButton>
							</p:column>

						</p:dataTable>
					</h:form>
					<!-- /Telefones -->




					<!-- Emails -->
					<br />
					<br />
					<h1 style="color: #333">Meus E-mails</h1>
					<h:form>
						<p:dataTable var="email" value="#{emailBean.emailsUL}">
							<p:column headerText="E-mail">
								<h:outputText value="#{email.email}" />
							</p:column>

							<p:column headerText="Tipo">
								<h:outputText value="#{email.tipo}" />
							</p:column>
							<p:column headerText="Ações">
								<p:commandButton value="Editar"
									actionListener="#{telefoneBean.editarTel(email)}" />
								<p:commandButton value="Excluir"
									actionListener="#{telefoneBean.removerTel(email)}">
									<p:confirm header="Tem certeza?"
										message="Você tem certeza que deseja apagar este email?"
										icon="ui-icon-alert" />
								</p:commandButton>
							</p:column>
						</p:dataTable>
					</h:form>
					<!-- /Emails -->


					<br />
					<br />


				</div>


			</div>

		</div>


		<div class='inner'>
			<div class='rdp' style='display: block'>
				<div class='menu'>
					<a href="home.xhtml">início</a> 
					<a href="user.xhtml">Busca</a> 
					<a href="sobre.xhtml">Sobre Nós</a> <a href="#">Política</a> 
					<a href="desenvolvedores.xhtml">Desenvolvedores</a>
				</div>
				Copyright&copy; Linkers - 2013 - Inovati Soluções
			</div>
		</div>

	</div>


	<p:dialog header="Configurações" widgetVar="dlgopcoes"
		showEffect="explode" modal="true" hideEffect="bounce" height="100">
		<h:form>
			<p:commandButton value="Editar Informações"
				actionListener="#{utils.redirect('editar')}" ajax="false" />
			<br />
			<p:commandButton value="Cancelar conta"
				actionListener="#{utils.redirect('cancelando')}" ajax="false" />
		</h:form>
	</p:dialog>


</body>
</html>